package com.idna.wsconsumer.xfire;

import java.net.MalformedURLException;
import java.net.URL;

import org.codehaus.xfire.client.Client;

public class XFireDynamicClient
{
	public void testSearch() throws MalformedURLException, Exception
	{
		//String xmlRequest = "<NetID type=\"Search\"><Authentication><Username>basil.eltom</Username><Password>letmein</Password></Authentication><IP>145.116.9.22</IP><AcceptableDistance>100</AcceptableDistance><Telephone>+442079092300</Telephone><Email>product.support@192.com</Email><BIN>401130</BIN><CustomerLocation><Address>sw62uz</Address><CountryCode>gbr</CountryCode><AddressSelection /></CustomerLocation><ShipToLocation><Address>120, w93en</Address><CountryCode>gbr</CountryCode><AddressSelection /></ShipToLocation></NetID>";
		String xmlRequest = "<ProveID type=\"Search\"><Authentication><Username>basil.eltom</Username><Password>letmein</Password></Authentication><Person><DateOfBirth>1944-10-13</DateOfBirth><Gender>Male</Gender><Name><Forename>John</Forename><OtherNames>Richard</OtherNames><Surname>Ferrari</Surname></Name><Aliases><Alias><Forename /><OtherNames /><Surname /></Alias></Aliases></Person><Address><SubPremise /><Premise>17</Premise><SubStreet /><Street /><SubLocality /><Locality /><PostTown /><Region /><Postcode>X99LF</Postcode></Address><Option><ERType>Edited</ERType></Option>    <Driving>       <LicenseNumber>FERRA410134JR12345 99</LicenseNumber>    </Driving><Passport><Number>M34045050</Number><Country>GBR</Country><Nationality>GBR</Nationality><ExpiryDate>2010-06-13 </ExpiryDate><MRZLine2>&lt;&lt;06&lt;</MRZLine2><PersonalNumber>&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;06&lt;</PersonalNumber></Passport></ProveID>";
		Client client = new Client(new URL("http://xml.192.com/ProveID.cfc?WSDL"));
		Object[]  results = client.invoke("search", new String[]{xmlRequest});
		System.out.println(results[0]);
	}
	public static void main(String[] args)
	{
		XFireDynamicClient client  = new XFireDynamicClient();
		try
		{
			client.testSearch();
		}
		catch (MalformedURLException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		catch (Exception e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
